package cn.shop.admin.common.async;

import cn.shop.admin.entity.backLogModule.BackLog;
import cn.shop.admin.service.BackLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author jzw
 * @since 2021-11-03 10:18
 */
@Component
@Slf4j
public class LogAsync {

	@Resource
	private BackLogService backLogService;

	/**
	 * 异步收集日志到mysql
	 *
	 * @param operationLog 日志实体类
	 * @author jzw
	 * @since 2021/11/17 10:09
	 */
	@Async("taskExecutor")
	public void operationLog(BackLog operationLog) {
		backLogService.save(operationLog);
	}

}
